require 'buildr/scala'
require 'buildr_iidea'
require 'dependencies'

# Version number for this release
VERSION_NUMBER = "0.1.1"
GROUP = "GUITforL"

# Maven 2.0 remote repositories:
repositories.remote << 'http://repo1.maven.org/maven2/'

# Enable scala fast compiler daemon
ENV['USE_FSC'] ||= 'yes'

# Tasks
Project.local_task :run

MainClass = ' guitforl.view.Main'

JTATOO_THEME = 'jtatoo:jtatoo:jar:1.3' 
jtatoo_art = artifact(JTATOO_THEME).from('/home/artem/Downloads/SwingTheme/JTattoo.jar')
install jtatoo_art

desc "The Guitforl project"
define "guitforl-swing" do
  project.version = VERSION_NUMBER
  project.group = GROUP

  compile.with SCALA, MiGLayout, transitive(JFREE_CHART), JLAFChooser, THEMES

  task :run => :compile do
    Java.classpath << artifacts(Artifact.list)
    Java.classpath << compile.target.to_s
    Java.load
    #puts Java.classpath
    cp = Buildr.artifacts(Java.classpath).map(&:to_s).each { |path| file(path).invoke }.join(File::PATH_SEPARATOR)
    system 'java -cp ' + cp + MainClass
  end
end
